import {axios} from './request.js'

//method, //请求方法
//header,  //请求头


//广告轮播
export const getbanner=()=>{
	return axios({
		url:'/prod-api/api/park/rotation/list',
		data:{}
	})
}

//查询换商品
export const getproduct=()=>{
	return axios({
		url:'/prod-api/api/park/product/list',
		data:{}
	})
}

//查询停车场列表
export const getpark=({data})=>{
	return axios({
		url:'/prod-api/api/park/lot/list',
		data,
	})
}

//获取停车场详细
export const getparkdetail=({id,data})=>{
	return axios({
		url:'/prod-api/api/park/lot/'+id,
		data
	})
}

//查询车辆信息
export const getcardeta=({header,data})=>{
	return axios({
		url:'/prod-api/park/car/list',
		header,
		data
	})
}


//查询停车记录列表
export const getrecord=({data})=>{
	return axios({
		url:'/prod-api/api/park/lot/record/list',
		data
	})
}



//获取新闻分类
export const getcategory=()=>{
	return axios({
		url:'/prod-api/api/park/press/category/list',
		data:{}
	})
}

//获取新闻列表
export const getnew=({data})=>{
	return axios({
		url:'/prod-api/api/park/press/press/list',
		data,
	})
}

//获取新闻详细
export const getnewde=({id,data})=>{
	return axios({
		url:"/prod-api/api/park/press/press/"+id,
		data
	})
}

//新闻点赞
export const gotolike=({id,header,data})=>{
	return axios({
		url:'/prod-api/api/park/press/press/like/'+id,
		method:'put',
		header,
		data
	})
}

//获取新闻评论详情
export const getpingdeta=({id})=>{
	return axios({
		url:'/prod-api/api/park/press/comments/'+id,
		data:{}
	})
}

//获取获取新闻评论列表
export const getpinglist=({data})=>{
	return axios({
		url:'/prod-api/api/park/press/comments/list',
		data
	})
}

//新闻评论点赞
export const gotopressComment=({id,header})=>{
	return axios({
		url:'/prod-api/api/park/press/pressComment/like/'+id,
		method:'put',
		header,
		data:{}
	})
}

//发表新闻评论
export const sendpressComment=({header,data})=>{
	return axios({
		url:'/prod-api/api/park/press/pressComment',
		method:'post',
		header,
		data
	})
}

//查询充值记录列表
export const gorecharge=({header})=>{
	return axios({
		url:'/prod-api/api/park/recharge/list',
		header,
		data:{}
	})
	
}

//充值
export const gotopay =({data})=>{

	return axios({
		url:'prod-api/api/park/recharge/pay',
		method:'post',
		header:{
			"Authorization":uni.getStorageSync('token'),
			
		},
		data
		
	})
}

//查询意见反馈列表
export const getfeedback=({header})=>{
	return axios({
		url:'/prod-api/api/park/feedback/list',
		header,
		data:{}
	})
}

//新增反馈意见
export const addfeeddate=({header,data})=>{
	return axios({
		url:'/prod-api/api/park/feedback',
		method:'post',
		header,
		data
	})
}

//添加我的车辆信息
export const addcar=({header,data})=>{
   
   return axios({
	   url:'/prod-api/api/park/car',
	   method:'post',
	   header,
	   data
   })
}

//查询我的车辆信息
export const getcart=({header})=>{
	return axios({
		url:'/prod-api/api/park/car/my',
		header
	})
	
}

//修改我的车辆信息
export const fixmycart=({header,data})=>{
	return axios({
		url:'/prod-api/api/park/car',
		method:'put',
		header,
		data
	})
}

//删除我的车辆信息
export const deletecart =({id,header})=>{
	return axios({
		url:'/prod-api/api/park/car/'+id,
		method:'DELETE',
		header,
		data:{}
	})
}

//查询我的车辆里程
export const getconsumption=({header,data})=>{
	return axios({
		url:'/prod-api/api/park/car/consumption',
		header,
		data
	})
}

//添加车辆里程信息
export const gettrip=({header,data})=>{
	return axios({
		url:'/prod-api/api/park/car/consumption',
		method:'post',
		header,
		data
	})
}

//修改车辆里程信息
 export const tofixtrip=({header,data})=>{
	 return axios({
		 url:'/prod-api/api/park/car/consumption',
		 method:'put',
		 header,
		 data
	 })
 }
 
 //删除车辆里程信息
 export  const deletrip=({id,header})=>{
	 return axios({
		 url:'/prod-api/api/park/car/consumption/'+id,
		  method:'delete',
		  header,
		  data:{}
	 })
 }
 
 //申请挪车
 export const movecart=({header,data})=>{
	 return axios({
		url:'/prod-api/api/park/car/move',
		 method:'post',
		 header,
		 data
	 })
 }
 
 //挪车历史
 export const historycart=({header,data})=>{
	return axios({
		url:'/prod-api/api/park/car/history/list',
		header,
		data
	}) 
 }
 
 //纠错信息
 export const gocorrect=({header,data})=>{
	 return axios({
		 url:'/prod-api/api/park/correct',
		 method:'post',
		 header,
		 data
	 })
 }


//查询积分记录列表
export const getlevel=({header})=>{
	return axios({
		url:'/prod-api/api/park/score/list',
		header,
		data:{}
	})
}

//查询积分等级列表
export const getlevlist =({header})=>{
	return axios({
		url:'/prod-api/api/park/score/level/list',
		header,
		data:{}
	})
}

//积分兑换
export const goconsume=({productId,header})=>{
	return axios({
		url:'/prod-api/api/park/score/consume/'+productId,
		method:'post',
		header,
		data:{}
	})
}

//积分排行榜
export const gettop =({header,data})=>{
	return axios({
		url:'/prod-api/api/park/score/top/list',
		header,
		data
	})
}